<style lang="scss" scoped>
    #default-chart{
        width: 100%;
        height: 100%;;
    }
</style>

<template>
    <div id="default-chart"></div>
</template>

<script>
    // 引入 echarts 主模块。
    import * as echarts from 'echarts/lib/echarts';
    import 'echarts/lib/chart/line';
    import 'echarts/lib/component/tooltip';
    import 'echarts/lib/component/title';
    import 'echarts/lib/component/toolbox';

    export default {
        props: {
            options: {
                type: Object,
                default: () => {}
            }
        },
        data() {
            return {

            }
        },
        mounted() {
            this.init();
        },
        methods: {
            init() {
                let chart = echarts.init(document.getElementById('default-chart'))
                chart.setOption(this.options)
            }
        }
    }
</script>
